package com.linkq.ipinyin.controller;

import com.linkq.ipinyin.model.Feedback;
import com.linkq.ipinyin.service.FeedbackService;
import com.linkq.ipinyin.vo.ResultInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @FileName FeedBackController
 * @Description
 * @Author wangpeng
 * @date 2025-03-01
 **/

@RestController
@RequestMapping("feedback")
public class FeedBackController {

    @Autowired
    private FeedbackService feedbackService;

    /**
     * 提交反馈意见
     * @param feedback
     * @param files
     * @return
     */
    @PostMapping("submit")
    public ResultInfo feedback(Feedback feedback, @RequestParam(value = "files", required = false)List<MultipartFile> files) {
        return feedbackService.submitFedBack(feedback, files);
    }

    /**
     * 更新反馈意见状态
     * @param feedback
     * @return
     */
    @PostMapping("changeStatus")
    public ResultInfo changeStatus(@RequestBody Feedback feedback) {
        return feedbackService.changeStatus(feedback);
    }

    /**
     * 获取我的反馈意见
     * @param feedback
     * @return
     */
    @PostMapping("getMyFeedback")
    public ResultInfo getMyFeedback(@RequestBody Feedback feedback) {
        return feedbackService.getMyFeedback(feedback);
    }



}
